package hotciv.variants;

import java.util.HashMap;
import java.util.Map;

import hotciv.common.*;
import hotciv.framework.GameConstants;
import hotciv.framework.Player;
import hotciv.framework.Position;
import hotciv.strategies.LayoutStrategy;

public class DeltaCivLayoutStrategy implements LayoutStrategy {

	private Map<Position, CityImpl> cities = new HashMap<Position,CityImpl>();
	private Map<Position, UnitImpl> units = new HashMap<Position,UnitImpl>();
	private Map<Position, TileImpl> tiles = new HashMap<Position,TileImpl>();
	private Map<Position, Integer> cityProductionStashes = new HashMap<Position,Integer>();

	public DeltaCivLayoutStrategy(){

		String[] world = {
			"...ooMooooo.....",
			"..ohhoooofffoo..",
			".oooooMooo...oo.",
			".ooMMMoooo..oooo",
			"...ofooohhoooo..",
			".ofoofooooohhoo.",
			"...ooo..........",
			".ooooo.ooohooM..",
			".ooooo.oohooof..",
			"offfoooo.offoooo",
			"oooooooo...ooooo",
			".ooMMMoooo......",
			"..ooooooffoooo..",
			"....ooooooooo...",
			"..ooohhoo.......",
			".....ooooooooo..",
		};
		tiles = WorldCreator.createWorldFromStringArray(world, true);

		/* Create cities */
		cities.put(new Position(8,12), new CityImpl(Player.RED));
		cities.put(new Position(4,5), new CityImpl(Player.BLUE));
		
		/* Create units */
		units.put(new Position(3,8), new UnitImpl(Player.RED, GameConstants.ARCHER));
		units.put(new Position(4,4), new UnitImpl(Player.BLUE, GameConstants.LEGION));
		units.put(new Position(5,5), new UnitImpl(Player.RED, GameConstants.SETTLER));
	}

	@Override
	public Map<Position, CityImpl> getCities() {
		return cities;
	}

	@Override
	public Map<Position, Integer> getCityProductionStashes() {
		return cityProductionStashes;
	}

	@Override
	public Map<Position, UnitImpl> getUnits() {
		return units;
	}

	@Override
	public Map<Position, TileImpl> getTiles() {
		return tiles;
	}


}
